#define code

typedef unsigned char	UINT8;
typedef unsigned int	UINT16;
typedef unsigned long	UINT32;

#if 0
typedef unsigned char	uint8_t;
typedef unsigned int	uint16_t;
typedef unsigned long	uint32_t;
#else
#include <stdint.h>
#endif

typedef unsigned char	u8;
typedef unsigned int	u16;
typedef unsigned long	u32;

typedef enum {
	ERROR	= 0,
	SUCCESS = !ERROR
}
ErrorStatus;

ErrorStatus;
typedef enum
{
	OFF	= 0,
	ON	= 1
}
Fun_Status;

typedef  enum
{
	Low	= 0,
	High	= !Low
}
Pin_Status;

typedef enum
{
	FALSE	= 0,
	TRUE	= !FALSE
}
PinStatus;

typedef enum
{
	RESET	= 0,
	SET	= !RESET
}
FlagStatus, ITStatus, BitStatus, BitAction;

#if 1
#define Bit_RESET 0
#define Bit_SET 1
#include <stdbool.h>
#else
typedef enum
{
	Bit_RESET	= 0,
	Bit_SET		= !Bit_RESET
}bool;
#endif

typedef enum
{
	TX_0	= 0x01,
	TX_1	= 0x02,
	TX_2	= 0x04,
	TX_3	= 0x08,
	TX_ALL	= 0x0F
}LT86102UX_TX;

typedef enum {
	DISABLE = 0,
	ENABLE	= !DISABLE
}
FunctionalState;

typedef enum
{
	FixEq,
	AutoEq
}EqModeType;

typedef enum
{
	Tx_0	= 0x00,
	Tx_1	= 0x01,
	Tx_2	= 0x02,
	Tx_3	= 0x03
}
Tx_TypeDef;

#ifndef min
#define min( a, b ) ( ( (a) < (b) ) ? (a) : (b) )
#endif

#ifndef max
#define max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
#endif

#define     CID_READ	0x0B
#define     DID_READ	0x0C
#define     ERASE_APROM		0x22
#define     READ_APROM		0x00
#define     PROGRAM_APROM	0x21
#define     ERASE_LDROM
#define     READ_LDROM
#define     PROGRAM_LDROM
#define     READ_CFG	0xC0
#define     PROGRAM_CFG 0xE1
#define   READ_UID	0x04


void InitialUART0_Timer1( UINT32 u32Baudrate ); /*T1M = 1, SMOD = 1 */


void InitialUART0_Timer3( UINT32 u32Baudrate ); /*Timer3 as Baudrate, SMOD=1, Prescale=0 */


void InitialUART1_Timer3( UINT32 u32Baudrate );


void Send_Data_To_UART0( UINT8 c );


UINT8 Receive_Data_From_UART0( void );


void Send_Data_To_UART1( UINT8 c );


UINT8 Receive_Data_From_UART1( void );


void InitialUART1( UINT32 u32Baudrate );

#define HDMI_WriteI2C_Byte I2C_Write_Byte
#define HDMI_ReadI2C_Byte I2C_Read_Byte
#define HDMI_ReadI2C_ByteN I2C_Write_ByteN
int init_i2c(int i2cbus);
void I2C_Write_Byte(unsigned char RegAddr,unsigned char data);
unsigned char I2C_Read_Byte(unsigned char RegAddr);
bool I2C_Write_ByteN(u8 RegAddr, u8 *data, u16 Num);
int msleep(unsigned int ms);

